<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="../../vue.js"></script>
</head>

<body>
  <div id="app">
    <base-dialog>
      <template #header>
        <h1>header content</h1>
      </template>

      <template #main>
        <h1> main content {{username}}</h1>
      </template>


      <h1>footer content</h1>

    </base-dialog>

    <!-- <my-button>确定</my-button> -->
  </div>

  <script type="text/template" id="temp">

    <div>

      <header>
        from template title
        <slot name="header"></slot>
      </header>

      <main>
        {{username}}
        <slot name="main"></slot>
      </main>

      <footer>
        <slot></slot>
      </footer>


    </div>
  
  </script>

  <script>

    Vue.component('my-button', {
      template: `
  <button>
      <slot>submit</slot>
  </button>
  
  `
    })


    Vue.component('base-dialog', {
      template: "#temp",
      data() {
        return {
          username: 'hansai'
        }
      }

    })



    var vm = new Vue({
      el: "#app",
      data: {
        username: 'hanye'
      }
    })

  </script>

</body>

</html>